package com.ruoyi.shop.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.shop.api.domain.CheShop;
import com.ruoyi.shop.api.factory.RemoteRemoteShopFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@FeignClient(contextId = "remoteShopService", value = ServiceNameConstants.SHOP_SERVICE,fallbackFactory = RemoteRemoteShopFallbackFactory.class)

public interface RemoteShopService {

    @GetMapping("/shop/list")
    public TableDataInfo list(CheShop cheShop, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询门店排行列表
     */
@GetMapping("/shop/phone/{perPhone}")
public AjaxResult phone(@PathVariable("perPhone") String perPhone,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/shop/listByStar")
    public TableDataInfo listByStar(CheShop cheShop,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    /**
     * 获取门店管理详细信息
     */
    @GetMapping(value = "/shop/{shopId}")
   public AjaxResult getInfo(@PathVariable("shopId") Long shopId, @RequestHeader(SecurityConstants.AUTHORIZATION_HEADER) String source);


    /**
     * 新增门店管理
     */

    @PostMapping("/shop")
    public AjaxResult add(@RequestBody CheShop cheShop, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改门店管理
     */

    @PutMapping("/shop")
    public AjaxResult edit(@RequestBody CheShop cheShop, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 删除门店管理
     */

    @DeleteMapping("/shop/{shopIds}")
    public AjaxResult remove(@PathVariable("shopIds") Long[] shopIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
